<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWangguiSearchDotsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wanggui_search_dots', function (Blueprint $table) {
            $table->id();
            $table->string('wgNumber', 24)->default('')->comment('网规编号');
            $table->string('type', 36)->default('')->comment('网规类型');
            $table->string('address', 255)->default('')->comment('聚合搜索内容 address + name');
            $table->string('province', 24)->default('')->comment('省');
            $table->string('city', 24)->default('')->comment('市');
            $table->string('district', 24)->default('')->comment('区');
            $table->string('provinceCode', 24)->default('')->comment('省Code');
            $table->string('cityCode', 24)->default('')->comment('市Code');
            $table->string('districtCode', 24)->default('')->comment('区Code');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '网规聚合搜索表';

            $table->index('cityCode', 'idx_cityCode');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wanggui_search_dots');
    }
}
